<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>生鲜商城</title>
    <!-- 引入样式 -->
    <link
            rel="stylesheet"
            href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"
    />
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="js/jquery.js"></script>
</head>
<body>
<el-container id="app">
    <!--头部导航 -->
    <el-header style="height:510px">
        <el-menu
                :default-active="activeIndex"
                class="el-menu-demo"
                mode="horizontal"
                @select="handleSelect"
        >
            <div class="demo-image">
                <div class="block" :key="img.headbg">
                    <el-image
                            style="width: 1920px; height: 440px"
                            :src="img.headbg"
                            :fit="img.headbg">
                    </el-image>
                </div>
            </div>
            <el-menu-item index="0">首页</el-menu-item>
            <el-menu-item index="1">用户</el-menu-item>
            <el-menu-item index="2">商品</el-menu-item>
            <el-menu-item index="3">优惠券</el-menu-item>
            <el-menu-item index="4">秒杀</el-menu-item>
            <el-menu-item index="5">数据统计</el-menu-item>
            <el-menu-item index="6" ><a href="/logout">登出</a></el-menu-item>
           <!-- <el-button type="info" @>退出登录</el-button>-->
        </el-menu>
        <div class="line"></div>
    </el-header>
    <!-- 主体部分 请在下方写代码 -->
    <el-main>


    </el-main>
</el-container>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            //此处请改为对应的选项
            activeIndex: "0",
            img: {
                headbg: '/img/bg/banner3back.jpg',
            },
        },
        methods: {
            //导航 添加中
            handleSelect: function (key, keyPath) {
                console.log(key, keyPath);
                if(key==0){
                    window.location.href="/index"
                }else if(key==1){
                    window.location.href="/user"
                }else if(key==2){
                    window.location.href="/product"
                }else if(key==3){
                    window.location.href="/coupon"
                }else if(key==4){
                    window.location.href="/limited"
                }else if(key==5){
                    window.location.href="/statistics"
                }else if(key==6){
                    this.exit();
                }
            }
            /*exit:function(){
                $.ajax({
                    url:"/freshmarket/manager/logout",
                    type:"get",
                    success:function () {
                        /!*if(data.success){
                            window.location="/loginer";
                        }else{
                            alert(data.message);
                        }*!/
                    }
                });
            }*/
        },
        //生命周期初始化
        mounted: function () {
        },
    });
</script>
</body>
</html>
